using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._BusinessAnalystTools._TradeAreas
{
    /// <summary>
    /// <para>Assign Customers By Distance</para>
    /// <para>Assigns customers to the closest store based on a selected distance type.</para>
    /// <para>根据选定的距离类型将客户分配到最近的商店。</para>
    /// </summary>    
    [DisplayName("Assign Customers By Distance")]
    public class AssignCustomersByDistance : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AssignCustomersByDistance()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Customer Features</para>
        /// <para>The input point feature layer representing customers.</para>
        /// <para>表示客户的输入点要素图层。</para>
        /// </param>
        /// <param name="_in_store_features">
        /// <para>Input Store Features</para>
        /// <para>The input point feature layer representing store or facilities.</para>
        /// <para>表示商店或设施点的输入点要素图层。</para>
        /// </param>
        /// <param name="_store_id_field">
        /// <para>Store ID Field</para>
        /// <para>A unique ID field for Input Store Features.</para>
        /// <para>输入存储要素的唯一 ID 字段。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>A point layer containing customers with assigned store or facility and distance.</para>
        /// <para>包含具有指定商店或设施和距离的客户的点图层。</para>
        /// </param>
        public AssignCustomersByDistance(object _in_features, object _in_store_features, object _store_id_field, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._in_store_features = _in_store_features;
            this._store_id_field = _store_id_field;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Business Analyst Tools";

        public override string ToolName => "Assign Customers By Distance";

        public override string CallName => "ba.AssignCustomersByDistance";

        public override List<string> AcceptEnvironments => ["baDataSource", "baNetworkSource", "workspace"];

        public override object[] ParameterInfo => [_in_features, _in_store_features, _store_id_field, _out_feature_class, _link_field, _distance_type, _distance_units, _travel_direction.GetGPValue(), _time_of_day, _time_zone.GetGPValue(), _search_tolerance];

        /// <summary>
        /// <para>Input Customer Features</para>
        /// <para>The input point feature layer representing customers.</para>
        /// <para>表示客户的输入点要素图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Customer Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Input Store Features</para>
        /// <para>The input point feature layer representing store or facilities.</para>
        /// <para>表示商店或设施点的输入点要素图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Store Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_store_features { get; set; }


        /// <summary>
        /// <para>Store ID Field</para>
        /// <para>A unique ID field for Input Store Features.</para>
        /// <para>输入存储要素的唯一 ID 字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Store ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _store_id_field { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>A point layer containing customers with assigned store or facility and distance.</para>
        /// <para>包含具有指定商店或设施和距离的客户的点图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Field Name</para>
        /// <para>A new field that contains the assigned store or facility ID.</para>
        /// <para>包含已分配的商店或设施 ID 的新字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _link_field { get; set; } = null;


        /// <summary>
        /// <para>Distance Type</para>
        /// <para>The method of travel used to calculate the distance between customers and stores.</para>
        /// <para>用于计算客户和商店之间距离的旅行方法。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _distance_type { get; set; } = null;


        /// <summary>
        /// <para>Distance Units</para>
        /// <para>The units that will be used to measure the selected distance type.</para>
        /// <para>将用于测量所选距离类型的单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Units")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _distance_units { get; set; } = null;


        /// <summary>
        /// <para>Travel Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction of travel that will be used between stores or facilities and customers.</para>
        ///   <bulletList>
        ///     <bullet_item>Toward Stores—The direction of travel will be from customers to stores. This is the default.</bullet_item><para/>
        ///     <bullet_item>Away from Stores—The direction of travel will be from stores to customers.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定商店或设施点与客户之间将使用的行进方向。</para>
        ///   <bulletList>
        ///     <bullet_item>朝向商店 - 行进方向将从客户到商店。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>远离商店 - 行进方向将从商店到客户。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel Direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _travel_direction_value _travel_direction { get; set; } = _travel_direction_value._TOWARD_STORES;

        public enum _travel_direction_value
        {
            /// <summary>
            /// <para>Toward Stores</para>
            /// <para>Toward Stores—The direction of travel will be from customers to stores. This is the default.</para>
            /// <para>朝向商店 - 行进方向将从客户到商店。这是默认设置。</para>
            /// </summary>
            [Description("Toward Stores")]
            [GPEnumValue("TOWARD_STORES")]
            _TOWARD_STORES,

            /// <summary>
            /// <para>Away from Stores</para>
            /// <para>Away from Stores—The direction of travel will be from stores to customers.</para>
            /// <para>远离商店 - 行进方向将从商店到客户。</para>
            /// </summary>
            [Description("Away from Stores")]
            [GPEnumValue("AWAY_FROM_STORES")]
            _AWAY_FROM_STORES,

        }

        /// <summary>
        /// <para>Time of Day</para>
        /// <para>The time and date that will be used when calculating distance.</para>
        /// <para>计算距离时将使用的时间和日期。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time of Day")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_of_day { get; set; } = null;


        /// <summary>
        /// <para>Time Zone</para>
        /// <para><xdoc>
        ///   <para>Specifies the time zone that will be used for the Time of Day parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Time Zone at Location—The time zone in which the territories are located will be used. This is the default.</bullet_item><para/>
        ///     <bullet_item>UTC—Coordinated universal time (UTC) will be used.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于“时间”参数的时区。</para>
        ///   <bulletList>
        ///     <bullet_item>位置时区—将使用区域所在的时区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>UTC—将使用协调世界时 （UTC）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Zone")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _time_zone_value _time_zone { get; set; } = _time_zone_value._TIME_ZONE_AT_LOCATION;

        public enum _time_zone_value
        {
            /// <summary>
            /// <para>UTC</para>
            /// <para>UTC—Coordinated universal time (UTC) will be used.</para>
            /// <para>UTC—将使用协调世界时 （UTC）。</para>
            /// </summary>
            [Description("UTC")]
            [GPEnumValue("UTC")]
            _UTC,

            /// <summary>
            /// <para>Time Zone at Location</para>
            /// <para>Time Zone at Location—The time zone in which the territories are located will be used. This is the default.</para>
            /// <para>位置时区—将使用区域所在的时区。这是默认设置。</para>
            /// </summary>
            [Description("Time Zone at Location")]
            [GPEnumValue("TIME_ZONE_AT_LOCATION")]
            _TIME_ZONE_AT_LOCATION,

        }

        /// <summary>
        /// <para>Search Tolerance</para>
        /// <para><xdoc>
        ///   <para>The maximum distance that input points can be from the network. Points located beyond the search tolerance will be excluded from processing.</para>
        ///   <para>The parameter requires a distance value and units for the tolerance. The default value is 5000 meters.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入点与网络的最大距离。超出搜索容差范围的点将被排除在处理范围之外。</para>
        ///   <para>该参数需要距离值和公差单位。默认值为 5000 米。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _search_tolerance { get; set; } = null;


        public AssignCustomersByDistance SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}